{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 6. Linear Model Selection and Regularisation – Conceptual\n",
    "\n",
    "Excercises from **Chapter 6* of [An Introduction to Statistical Learning](http://www-bcf.usc.edu/~gareth/ISL/) by Gareth James, Daniela Witten, Trevor Hastie and Robert Tibshirani."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1. We perform best subset, forward stepwise, and backward stepwise selection on a single data set. For each approach, we obtain p + 1 models, containing 0, 1, 2, . . . , p predictors. Explain your answers:\n",
    "\n",
    "\n",
    "### (a) Which of the three models with k predictors has the smallest training RSS?\n",
    "\n",
    "Best subset selection will exhibit the smallest training RSS because all possible combinations of predictors are considered for a given k. It is possible that the most effective model is also found by forward stepwise or backward stepwise, but not possible that they will find a model more effective than best subset, as the former consider a subset of the models considered by best subset selection.\n",
    "\n",
    "### (b) Which of the three models with k predictors has the smallest test RSS?\n",
    "\n",
    "Best subset selection will certainly yield the smallest test rss, this model might also be discovered by forward stepwise or backward stepwise but this is not certain.\n",
    "\n",
    "### (c) True or False:\n",
    "\n",
    "- i. The predictors in the k-variable model identified by forward stepwise are a subset of the predictors in the (k+1)-variable model identified by forward stepwise selection.\n",
    "\n",
    "    - True\n",
    "\n",
    "- ii. The predictors in the k-variable model identified by backward stepwise are a subset of the predictors in the (k + 1)- variable model identified by backward stepwise selection.\n",
    "\n",
    "    - True\n",
    "\n",
    "- iii. The predictors in the k-variable model identified by backward stepwise are a subset of the predictors in the (k + 1)- variable model identified by forward stepwise selection.\n",
    "\n",
    "    - False\n",
    "\n",
    "- iv. The predictors in the k-variable model identified by forward stepwise are a subset of the predictors in the (k+1)-variable model identified by backward stepwise selection.\n",
    "\n",
    "    - False\n",
    "\n",
    "- v. The predictors in the k-variable model identified by best subset are a subset of the predictors in the (k + 1)-variable model identified by best subset selection.\n",
    "\n",
    "    - False"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2. For parts (a) through (c), indicate which of i. through iv. is correct. Justify your answer.\n",
    "\n",
    "\n",
    "### (a) The lasso, relative to least squares, is:\n",
    "\n",
    "- i. More flexible and hence will give improved prediction accuracy when its increase in bias is less than its decrease in variance.\n",
    "\n",
    "    - Incorrect. Least squares uses all features, whereas lasso wil either use all features or set coefficients to zero for some features – so lasso is either equivalent to least squares or less flexible.\n",
    "\n",
    "- ii. More flexible and hence will give improved prediction accuracy when its increase in variance is less than its decrease in bias.\n",
    "\n",
    "    - Incorrect\n",
    "\n",
    "- iii. Less flexible and hence will give improved prediction accuracy when its increase in bias is less than its decrease in variance.\n",
    "\n",
    "    - Correct. As λ is increased the variance of the model will decrease quickly for a small increase in bias resulting in improved test MSE. At some point the bias will start to increase dramatically outweighing any benefits from further reduction in variance, at the expense of test MSE.\n",
    "\n",
    "- iv. Less flexible and hence will give improved prediction accuracy when its increase in variance is less than its decrease in bias.\n",
    "\n",
    "    - Incorrect\n",
    "\n",
    "### (b) Repeat (a) for ridge regression relative to least squares.\n",
    "\n",
    "- i. More flexible and hence will give improved prediction accuracy when its increase in bias is less than its decrease in variance.\n",
    "\n",
    "    - Incorrect. Same as for lasso\n",
    "\n",
    "- ii. More flexible and hence will give improved prediction accuracy when its increase in variance is less than its decrease in bias.\n",
    "\n",
    "    - Incorrect. Same as for lasso\n",
    "\n",
    "- iii. Less flexible and hence will give improved prediction accuracy when its increase in bias is less than its decrease in variance.\n",
    "\n",
    "    - Correct. Same as for lasso\n",
    "\n",
    "- iv. Less flexible and hence will give improved prediction accuracy when its increase in variance is less than its decrease in bias.\n",
    "    - Incorrect. Same as for lasso\n",
    "\n",
    "### (c) Repeat (a) for non-linear methods relative to least squares.\n",
    "\n",
    "- i. More flexible and hence will give improved prediction accuracy when its increase in bias is less than its decrease in variance.\n",
    "\n",
    "    - Incorrect\n",
    "\n",
    "- ii. More flexible and hence will give improved prediction accuracy when its increase in variance is less than its decrease in bias.\n",
    "\n",
    "    - Correct. If the data contains non-linear relationships then the reduction in bias will outweigh the increase in variance as the model better fitst the data. At some point the model will become too flexible and will start to overfit the data at which point increased variance will begin to outwiegh any further reduction in bias.\n",
    "\n",
    "- iii. Less flexible and hence will give improved prediction accuracy when its increase in bias is less than its decrease in variance.\n",
    "\n",
    "    - Incorrect\n",
    "\n",
    "- iv. Less flexible and hence will give improved prediction accuracy when its increase in variance is less than its decrease in bias.\n",
    "\n",
    "\n",
    "    - Incorrect\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3. Suppose we estimate the regression coefficients in a linear regression model by minimizing for a particular value of s. For parts (a) through (e), indicate which of i. through v. is correct. Justify your answer.\n",
    "\n",
    "\n",
    "### (a) As we increase s from 0, the training RSS will:\n",
    "\n",
    "- iv. Steadily decrease.\n",
    "\n",
    "As we increase s we increase the models flexibility, in the training setting this will lead to overfitting and a monotonic decrease in the RSS error.\n",
    "\n",
    "### (b) Repeat (a) for test RSS.\n",
    "\n",
    "- ii. Decrease initially, and then eventually start increasing in a U shape.\n",
    "\n",
    "The increased flexibility of our model improves our models performance in the test setting up until the point where our model starts to overfit the data.\n",
    "\n",
    "\n",
    "### (c) Repeat (a) for variance.\n",
    "\n",
    "- iii. Steadily increase.\n",
    "\n",
    "Reduced constraint on sum of coefficients means monotonic increase in flexibility – increase variance\n",
    "\n",
    "### (d) Repeat (a) for (squared) bias.\n",
    "\n",
    "- iv. Steadily decrease.\n",
    "\n",
    "Reduced constraint on sum of coefficients means monotonic decrease in bias.\n",
    "\n",
    "### (e) Repeat (a) for the irreducible error.\n",
    "\n",
    "- v. Remain constant.\n",
    "\n",
    "The irreducible error represents the inherent noise in our data, because this noise is random it contains no useful information and remains constant regardless of the models flexibility."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4. Suppose we estimate the regression coefficients in a linear regression model by minimizing for a particular value of λ. For parts (a) through (e), indicate which of i. through v. is correct. Justify your answer.\n",
    "\n",
    "### (a) As we increase λ from 0, the training RSS will:\n",
    "\n",
    "- iii. Steadily increase.\n",
    "\n",
    "As lambda increases a heavier penalty is placed on a higher total value of coefficients so the model becomes less flexible and so is less able to fite variability in the training data.\n",
    "\n",
    "### (b) Repeat (a) for test RSS.\n",
    "\n",
    "- ii. Decrease initially, and then eventually start increasing in a U shape.\n",
    "\n",
    "As lambda increases the models bias is increased reducing any overfitting of the training data and so improving the test RSS accuracy. At some point the bias will increase to the point that our model is less able to represent true relationships in the data.\n",
    "\n",
    "\n",
    "\n",
    "### (c) Repeat (a) for variance.\n",
    "\n",
    "- iv. Steadily decrease.\n",
    "\n",
    "As lambas increases a higher penalty is placed on model flexibility and so variance decreases.\n",
    "\n",
    "\n",
    "### (d) Repeat (a) for (squared) bias.\n",
    "\n",
    "- iii. Steadily increase.\n",
    "\n",
    "As lambda increases coefficient estimates are reduced and so bias increases.\n",
    "\n",
    "### (e) Repeat (a) for the irreducible error.\n",
    "\n",
    "- v. Remain constant.\n",
    "\n",
    "Irreducible error is not effected by the model."
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 5. It is well-known that ridge regression tends to give similar coefficient values to correlated variables, whereas the lasso may give quite different coefficient values to correlated variables. We will now explore this property in a very simple setting.\n",
    "\n",
    "## Suppose that n = 2, p = 2, x11 = x12, x21 = x22. Furthermore, suppose that y1+y2 =0 and x11+x21 =0 and x12+x22 =0, so that the estimate for the intercept in a least squares, ridge regression, or lasso model is zero: βˆ0 = 0.\n",
    "\n",
    "### (a) Write out the ridge regression optimization problem in this setting.\n",
    "\n",
    "![6_5.jpg](./images/6_5.jpg)\n",
    "\n",
    "### (b) Argue that in this setting, the ridge coefficient estimates satisfy βˆ 1 = βˆ 2 .\n",
    "\n",
    "![6_5bi.jpg](./images/6_5bi.jpg)\n",
    "![6_5bii.jpg](./images/6_5bii.jpg)\n",
    "\n",
    "### (c) Write out the lasso optimization problem in this setting.\n",
    "\n",
    "### (d) Argue that in this setting, the lasso coefficients βˆ1 and βˆ2 are not unique—in other words, there are many possible solutions to the optimization problem in (c). Describe these solutions.\n",
    "\n",
    "![6_5cd.jpg](./images/6_5cd.jpg)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 6. We will now explore (6.12) and (6.13) further."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### (a) Consider (6.12) with p = 1. For some choice of y1 and λ > 0, plot (6.12) as a function of β1. Your plot should confirm that (6.12) is solved by (6.14)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAEKCAYAAADn+anLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFsBJREFUeJzt3X+MHPd53/H3c6SOYZlrfKbOV4YnhYLDEJHSmlavilu2gWzFsWy0oBREjlw0FBqVNCAJsAG3hZT+ERetYbeprTpBI1SMBJOBI0VITIhwBDuyIlcIEP84uaosWWDEynJ0EkMy1EVmGUaH4z39Y+eoE3Vzt7u82dnbeb+Axe5+d/b4zO7MfjjfmflOZCaSJC1lqO4CJEn9y5CQJJUyJCRJpQwJSVIpQ0KSVMqQkCSVMiQkSaUMCUlSKUNCklRqfd0FXIxLL700t23bVncZUvuOHGnd79hRbx1qtCeffPKvMnOsnWnXdEhs27aNqampusuQ2nftta37r3+9zirUcBHxg3antbtJklTKkJAklTIkJEmlDAlJUilDQpJUak0f3dSN+fnk1JlZZufOMbx+HZs3DTM0FHWXJUl9qVEhMT+fHDl+mr0Hp5ieOcvE6Eb275lkx/iIQSFJS2hUd9OpM7PnAwJgeuYsew9OcerMbM2VSVJ/alRIzM6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W8vg9kSETE1yLimSVuy/2vccXBBdeiFT6Le4B3AjuBY8Bnay22egP5HXdgV2ZeTau77faI+Lm6C1JPdbW+990Z16shM3++i7etOLjgWtTuZxER+4EvV1xO3QbyO25XZr5S3J+IiEO0ut+eWP5dA+d4RGzJzGMRsQU4UXdBvZKZxxced7K+D+SWRJcOAzdHxIaIuALYDnyr5poqVawkC26ktVN/kH0b2B4RV0TEMK0DFQ7XXFNPRMSmiBhZeAz8AoP/fS/lMHBL8fgW4OEaa+mpbtf3gdySWE5E3Aj8FjAG/FFEPJWZH8jMZyPiIeB7wBxwe2aeq7PWHvivEbGTVpfLi8BH6y2nWp0OIDlgxoFDEQGt9f73MvMr9ZZUrYh4ALgWuDQipoFfBz4DPBQRtwJ/AdxUX4XVKZn3a7tZ3z3jWpJUyu4mSVIpQ0KSVMqQkCSVMiQkSaUMCUlSKUNCWgURcUdE/HkxwvCni7bSEYeltcJDYKWLFBEbaJ25vR14jdb4UFcBfw+YB/4n8G8zc+CH59bgadzJdFIFxoG/zMxXI+Kqou21zJwBKE5gk9Yku5ukizcEZETcBTwNPJyZ8zXXJK0KQ0JaJZn5aVrDvWyLiL111yOtBkNCWkWZ+SrwAHB13bVIq8GQkFbHZRHxU8XjnwWWuvqhtOYYEtLqmAMejojvAj8O/E5E3FiMwPmPaY04/NVaK5S64CGw0kWKiG3AlzPzZ2ouRVp1bklIkkq5JSFJKuWWhCSplCEhSSplSEiSShkSkqRShoQkqZQhIUkq9f8BCppdlTAPTQ0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "\n",
    "\n",
    "def rr(y1, β1, λ):\n",
    "    return np.power(y1 - β1, 2) + λ*(β1**2)\n",
    "\n",
    "y1 = 5\n",
    "λ  = 1\n",
    "β = list(range(-10, 15))\n",
    "results = [rr(y1, β1, λ) for β1 in β]\n",
    "βR = y1/(1+λ)\n",
    "\n",
    "ax = sns.scatterplot(x=β, y=results)\n",
    "ax.axvline(x=βR, color='r')\n",
    "plt.xlabel('β1')\n",
    "plt.ylabel('Cost');\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### (b) Consider (6.13) with p = 1. For some choice of y1 and λ > 0, plot (6.13) as a function of β1. Your plot should confirm that (6.13) is solved by (6.15)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "np.absolute(y1) <= λ/2\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAEKCAYAAADn+anLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFXBJREFUeJzt3X9s3Hd9x/HXywnOQjDDTV0v5AdBLERrkQid17Flm4LYaKkmpUEra7eRwKoEqa0EG2xr2R+gSRVljJ/TUi1ZqyYTtKoGUaNSAaVrVRENqIOi/sqyRlBaN8EJadRaaYjl3Ht/3PfM1fHXvjvf977fu+/zIVl3/vjOfl/d8yvfz09HhAAAmE1f3gUAAIqLkAAApCIkAACpCAkAQCpCAgCQipAAAKQiJAAAqQgJAEAqQgIAkGpx3gUsxMUXXxxr167Nuwx0kyNHqrfr1+dbB5CjgwcP/iIihhp5bFeHxNq1azU6Opp3GegmmzZVbx99NM8qgFzZ/lmjj6W7CQCQipAAAKQiJAAAqQgJAEAqQgIAkKqrZzcBQNlUKqFTZyY1OXVe/YsXafmyfvX1ObOfR0gAQJeoVEJHxie0fe+oxk6f1arBpdq9dUTrhwcyCwq6mwCgS5w6MzkdEJI0dvqstu8d1akzk5n9TEICALrE5NT56YCoGTt9VpNT5zP7mY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sy6ruD3WZpN+QVJH075I+GRE9vz03ek/pFtMBGRiW9POIeMn2ZUnbyxFxWpKSBWxAV6K7CVi4Pklh+1ZJT0i6PyIqOdcEtAUhAbRJRHxW1e1e1trennc9QDsQEkAbRcRLku6RdHnetQDtQEgA7bHa9tuT+78rabbTD4GuQ0gA7TEl6X7bT0p6s6T/sL0l2YHz91Tdcfg7uVYItIApsMAC2V4r6YGIeEfOpQBtx5UEACAVVxIAgFRcSQAAUhESAIBUhAQAIBUhAQBIRUgAAFIREgCAVP8Pt/fr56r8fwoAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "def lasso(y1, β1, λ):\n",
    "    return np.power(y1 - β1, 2) + λ*(np.absolute(β1))\n",
    "\n",
    "y1 = -1\n",
    "λ  = 3\n",
    "β = list(range(-10, 15))\n",
    "results = [lasso(y1, β1, λ) for β1 in β]\n",
    "\n",
    "if y1 > λ/2:\n",
    "    print('y1 > λ/2')\n",
    "    βL = y1 - λ/2\n",
    "if y1 < -λ/2:\n",
    "    print('y1 < -λ/2')\n",
    "    βL = y1 + λ/2\n",
    "if np.absolute(y1) <= λ/2:\n",
    "    print('np.absolute(y1) <= λ/2')\n",
    "    βL = 0\n",
    "\n",
    "ax = sns.scatterplot(x=β, y=results)\n",
    "ax.axvline(x=βL, color='r')\n",
    "plt.xlabel('β1')\n",
    "plt.ylabel('Cost');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAHr1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jpwc7qnQEheK6WtJPgh4EAne6pH0pP+9XyP7hI3hmNkfSIkkvBDuSdDVxyE6hzOwZSadkeOhm59zjJ665WaNTwwfLObYg+Pk8alymY/1Y5gePmTVL2ijp8865I0GPJxVBwQfn3J/metzMPiNpiaSLXA2s8Z3o84D2S5qd8vMsSb8NaCwIGTNr0GhAeNA592jQ4xmL9FGBzOwSSWskXeqcOxb0eBAKL0k628zOMrOopL+S9ETAY0IImJlJulvSbufcN4IeTyYEhcJ9R9I0SU+b2Stm1hX0gIJkZpeZ2X5J50t6ysw2BT2mcjux8OBzkjZptJD4I+fca8GOKjhm9kNJz0uaZ2b7zeyaoMcUoAslLZf0sRP3i1fM7JNBDyoVO5oBAB5mCgAAD0EBAOAhKAAAPAQFAICHoAAA8BAUgCIxs5+aWa+ZPRn0WIB8ERSA4rlNo2vQgYpFUAAmycw+cuL8jClm1nSiL/4C59yzkvqCHh9QCHofAZPknHvJzJ6Q9FVJMUkPOOdq/gAZVAeCApCff9Joj6Pjkm4IeCxA0ZA+AvLze5KaNdr3akrAYwGKhqAA5OdOSWs1en7G+oDHAhQN6SNgksxshaRh59xDJ85jfs7MPibpFkkfkNR8olPsNc65musSi8pGl1QAgIf0EQDAQ1AAAHgICgAAD0EBAOAhKAAAPAQFAICHoAAA8BAUAACe/w/gBeOThHa9qAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "np.random.seed(1)\n",
    "x1 = np.random.normal(0, 1, 100)\n",
    "y_hat = x1 + np.random.normal(0, 1, 100)*0.2\n",
    "\n",
    "ax = sns.scatterplot(x=x1, y=y_hat)\n",
    "plt.xlabel('x1')\n",
    "plt.ylabel('y_hat');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEKCAYAAAAFJbKyA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j8eBZ4HloeN6hgljjA+B/xd6CAkqOXAyzWfDxPRiUHiYWargDOBZ8NGcoxu5JQiM/sOcEqdb93k7o9MHnMTE8PQr+cZWwitvB4lVu9WgmpxlGnMbCGwBfhv7v6L0PFUKXGkyN3Pne37ZnYlcAFwjpegD7rZ61Fyw8DKms9XAK8GikUiZGbzmUgaX3f3b4aOp5ZKVTkxs/OBjcCF7n4wdDwS3HZgjZmtNrMe4FJga+CYJBJmZsBfAs+7+/8KHc9MShz5+QtgEfCEmf3IzO4OHVBIZnaRmQ0DHwG+ZWaPh44pT5ONEtcDjzMx8fmQuz8XNqpwzOyvge8Bp5nZsJl9PnRMga0HLgc+Onm++JGZ/afQQVVp5biIiCSiEYeIiCSixCEiIokocYiISCJKHCIikogSh4iIJKLEIZIzM/t7M9tvZo+GjkWkHUocIvm7g4kefZFCUuIQyYiZ/crk/VdOMLP+yfsqnO7u3wVGQ8cn0i7tVSWSEXffbmZbgT8G+oAH3V03KpLCU+IQydbNTOxLdRi4IXAsIqlQqUokW+8FFjKxT9kJgWMRSYUSh0i2NgObmLj/ym2BYxFJhUpVIhkxsyuAcXf/q8l7jD9tZh8F/gfwb4CFkzsEf97dS7U7sBSbdscVEZFEVKoSEZFElDhERCQRJQ4REUlEiUNERBJR4hARkUSUOEREJBElDhERSUSJQ0REEvn/e/FB4NC5YrcAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "np.random.seed(1)\n",
    "x1 = np.random.normal(0, 1, 100)\n",
    "y_hat = np.random.normal(0, 1, 100)*0.2\n",
    "\n",
    "sns.scatterplot(x=x1, y=y_hat)\n",
    "plt.xlabel('x1')\n",
    "plt.ylabel('y_hat');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
